From: Luca BRUNO Date: Tue, 26 Oct 2021 16:27:22 +0000 (+0000) Subject: prepare-root: get rid of a global variable X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2^2~10^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=7c17daad175a9e8bd876c3c548db0bdd4449b895;p=ostree.git prepare-root: get rid of a global variable This moves a global mutable variable to a smaller local scope, as it is not really used outside of that. --- diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 20b8685d..46283f3f 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -81,9 +81,6 @@ #include "ostree-mount-util.h" -/* Initialized early in main */ -static bool running_as_pid1; - static inline bool sysroot_is_configured_ro (const char *sysroot) { @@ -175,7 +172,7 @@ main(int argc, char *argv[]) * - Quiet logging as there's no journal * etc. */ - running_as_pid1 = (getpid () == 1); + bool running_as_pid1 = (getpid () == 1); const char *root_arg = NULL; bool we_mounted_proc = false;